<template>
  <div class="detail-basic-info" v-if="Object.keys(detailBasicInfoObject).length">
    <p class="title">{{ detailBasicInfoObject.title }}</p>
    <p class="price">
      <span>{{ detailBasicInfoObject.price }}</span>
      <span>{{ detailBasicInfoObject.oldPrice }}</span>
      <span>{{ detailBasicInfoObject.discountDesc }}</span>
    </p>
    <div class="columns">
      <span class="text-left">
        {{ detailBasicInfoObject.columns[0] }}
      </span>
      <span class="text-center">
        {{ detailBasicInfoObject.columns[1] }}
      </span>
      <span class="text-right">
        {{ detailBasicInfoObject.services[detailBasicInfoObject.services.length - 1].name }}
      </span>
    </div>
    <div class="services">
      <span v-for="index in detailBasicInfoObject.services.length - 1" :key="index">
        <img v-lazy="detailBasicInfoObject.services[index-1].icon" alt="">
        {{ detailBasicInfoObject.services[index - 1].name }}
      </span>
    </div>
  </div>
</template>

<script>

export default {
  name: "DetailBasicInfo",
  props: {
    detailBasicInfoObject: {
      type: Object,
      default() {
        return {};
      }
    },
  },
}
</script>

<style scoped>
.detail-basic-info {
  padding: 0 8px;
  border-bottom: 5px solid #f2f5f8;
}

.detail-basic-info p {
  margin: 15px 0;
}

.detail-basic-info .title {
  color: #000;
}

.detail-basic-info .price span:first-child {
  font-size: 24px;
  color: var(--color-tint);
}

.detail-basic-info .price span:nth-child(2) {
  text-decoration: line-through;
  color: #999;
  font-size: 13px;
  margin: 0 5px;
}

.detail-basic-info .price span:last-child {
  background: var(--color-high-text);
  border-radius: 8px;
  color: #fff;
  padding: 2px 5px;
  font-size: 12px;
  position: relative;
  top: -8px;
}

.columns {
  display: flex;
  padding: 12px 0;
  border-bottom: 1px solid rgba(100, 100, 100, 0.1);
  font-size: var(--font-size);
  color: #999;
}

.columns span {
  flex: 1;
}

.services {
  display: flex;
  margin: 20px 0;
  color: var(--color-text);
  justify-content: space-between;
}

.services span {
  font-size: 13px;
  display: flex;
}

.services span img {
  width: 14px;
  height: 14px;
  margin-right: 2px;
}
</style>